BEGIN;
SELECT count(*), avg(b) FROM t2 WHERE b>=0 AND b<1000;
SELECT count(*), avg(b) FROM t2 WHERE b>=100 AND b<1100;
SELECT count(*), avg(b) FROM t2 WHERE b>=200 AND b<1200;
SELECT count(*), avg(b) FROM t2 WHERE b>=300 AND b<1300;
SELECT count(*), avg(b) FROM t2 WHERE b>=400 AND b<1400;
SELECT count(*), avg(b) FROM t2 WHERE b>=500 AND b<1500;
SELECT count(*), avg(b) FROM t2 WHERE b>=600 AND b<1600;
SELECT count(*), avg(b) FROM t2 WHERE b>=700 AND b<1700;
SELECT count(*), avg(b) FROM t2 WHERE b>=800 AND b<1800;
SELECT count(*), avg(b) FROM t2 WHERE b>=900 AND b<1900;
SELECT count(*), avg(b) FROM t2 WHERE b>=1000 AND b<2000;
SELECT count(*), avg(b) FROM t2 WHERE b>=1100 AND b<2100;
SELECT count(*), avg(b) FROM t2 WHERE b>=1200 AND b<2200;
SELECT count(*), avg(b) FROM t2 WHERE b>=1300 AND b<2300;
SELECT count(*), avg(b) FROM t2 WHERE b>=1400 AND b<2400;
SELECT count(*), avg(b) FROM t2 WHERE b>=1500 AND b<2500;
SELECT count(*), avg(b) FROM t2 WHERE b>=1600 AND b<2600;
SELECT count(*), avg(b) FROM t2 WHERE b>=1700 AND b<2700;
SELECT count(*), avg(b) FROM t2 WHERE b>=1800 AND b<2800;
SELECT count(*), avg(b) FROM t2 WHERE b>=1900 AND b<2900;
SELECT count(*), avg(b) FROM t2 WHERE b>=2000 AND b<3000;
SELECT count(*), avg(b) FROM t2 WHERE b>=2100 AND b<3100;
SELECT count(*), avg(b) FROM t2 WHERE b>=2200 AND b<3200;
SELECT count(*), avg(b) FROM t2 WHERE b>=2300 AND b<3300;
SELECT count(*), avg(b) FROM t2 WHERE b>=2400 AND b<3400;
SELECT count(*), avg(b) FROM t2 WHERE b>=2500 AND b<3500;
SELECT count(*), avg(b) FROM t2 WHERE b>=2600 AND b<3600;
SELECT count(*), avg(b) FROM t2 WHERE b>=2700 AND b<3700;
SELECT count(*), avg(b) FROM t2 WHERE b>=2800 AND b<3800;
SELECT count(*), avg(b) FROM t2 WHERE b>=2900 AND b<3900;
SELECT count(*), avg(b) FROM t2 WHERE b>=3000 AND b<4000;
SELECT count(*), avg(b) FROM t2 WHERE b>=3100 AND b<4100;
SELECT count(*), avg(b) FROM t2 WHERE b>=3200 AND b<4200;
SELECT count(*), avg(b) FROM t2 WHERE b>=3300 AND b<4300;
SELECT count(*), avg(b) FROM t2 WHERE b>=3400 AND b<4400;
SELECT count(*), avg(b) FROM t2 WHERE b>=3500 AND b<4500;
SELECT count(*), avg(b) FROM t2 WHERE b>=3600 AND b<4600;
SELECT count(*), avg(b) FROM t2 WHERE b>=3700 AND b<4700;
SELECT count(*), avg(b) FROM t2 WHERE b>=3800 AND b<4800;
SELECT count(*), avg(b) FROM t2 WHERE b>=3900 AND b<4900;
SELECT count(*), avg(b) FROM t2 WHERE b>=4000 AND b<5000;
SELECT count(*), avg(b) FROM t2 WHERE b>=4100 AND b<5100;
SELECT count(*), avg(b) FROM t2 WHERE b>=4200 AND b<5200;
SELECT count(*), avg(b) FROM t2 WHERE b>=4300 AND b<5300;
SELECT count(*), avg(b) FROM t2 WHERE b>=4400 AND b<5400;
SELECT count(*), avg(b) FROM t2 WHERE b>=4500 AND b<5500;
SELECT count(*), avg(b) FROM t2 WHERE b>=4600 AND b<5600;
SELECT count(*), avg(b) FROM t2 WHERE b>=4700 AND b<5700;
SELECT count(*), avg(b) FROM t2 WHERE b>=4800 AND b<5800;
SELECT count(*), avg(b) FROM t2 WHERE b>=4900 AND b<5900;
SELECT count(*), avg(b) FROM t2 WHERE b>=5000 AND b<6000;
SELECT count(*), avg(b) FROM t2 WHERE b>=5100 AND b<6100;
SELECT count(*), avg(b) FROM t2 WHERE b>=5200 AND b<6200;
SELECT count(*), avg(b) FROM t2 WHERE b>=5300 AND b<6300;
SELECT count(*), avg(b) FROM t2 WHERE b>=5400 AND b<6400;
SELECT count(*), avg(b) FROM t2 WHERE b>=5500 AND b<6500;
SELECT count(*), avg(b) FROM t2 WHERE b>=5600 AND b<6600;
SELECT count(*), avg(b) FROM t2 WHERE b>=5700 AND b<6700;
SELECT count(*), avg(b) FROM t2 WHERE b>=5800 AND b<6800;
SELECT count(*), avg(b) FROM t2 WHERE b>=5900 AND b<6900;
SELECT count(*), avg(b) FROM t2 WHERE b>=6000 AND b<7000;
SELECT count(*), avg(b) FROM t2 WHERE b>=6100 AND b<7100;
SELECT count(*), avg(b) FROM t2 WHERE b>=6200 AND b<7200;
SELECT count(*), avg(b) FROM t2 WHERE b>=6300 AND b<7300;
SELECT count(*), avg(b) FROM t2 WHERE b>=6400 AND b<7400;
SELECT count(*), avg(b) FROM t2 WHERE b>=6500 AND b<7500;
SELECT count(*), avg(b) FROM t2 WHERE b>=6600 AND b<7600;
SELECT count(*), avg(b) FROM t2 WHERE b>=6700 AND b<7700;
SELECT count(*), avg(b) FROM t2 WHERE b>=6800 AND b<7800;
SELECT count(*), avg(b) FROM t2 WHERE b>=6900 AND b<7900;
SELECT count(*), avg(b) FROM t2 WHERE b>=7000 AND b<8000;
SELECT count(*), avg(b) FROM t2 WHERE b>=7100 AND b<8100;
SELECT count(*), avg(b) FROM t2 WHERE b>=7200 AND b<8200;
SELECT count(*), avg(b) FROM t2 WHERE b>=7300 AND b<8300;
SELECT count(*), avg(b) FROM t2 WHERE b>=7400 AND b<8400;
SELECT count(*), avg(b) FROM t2 WHERE b>=7500 AND b<8500;
SELECT count(*), avg(b) FROM t2 WHERE b>=7600 AND b<8600;
SELECT count(*), avg(b) FROM t2 WHERE b>=7700 AND b<8700;
SELECT count(*), avg(b) FROM t2 WHERE b>=7800 AND b<8800;
SELECT count(*), avg(b) FROM t2 WHERE b>=7900 AND b<8900;
SELECT count(*), avg(b) FROM t2 WHERE b>=8000 AND b<9000;
SELECT count(*), avg(b) FROM t2 WHERE b>=8100 AND b<9100;
SELECT count(*), avg(b) FROM t2 WHERE b>=8200 AND b<9200;
SELECT count(*), avg(b) FROM t2 WHERE b>=8300 AND b<9300;
SELECT count(*), avg(b) FROM t2 WHERE b>=8400 AND b<9400;
SELECT count(*), avg(b) FROM t2 WHERE b>=8500 AND b<9500;
SELECT count(*), avg(b) FROM t2 WHERE b>=8600 AND b<9600;
SELECT count(*), avg(b) FROM t2 WHERE b>=8700 AND b<9700;
SELECT count(*), avg(b) FROM t2 WHERE b>=8800 AND b<9800;
SELECT count(*), avg(b) FROM t2 WHERE b>=8900 AND b<9900;
SELECT count(*), avg(b) FROM t2 WHERE b>=9000 AND b<10000;
SELECT count(*), avg(b) FROM t2 WHERE b>=9100 AND b<10100;
SELECT count(*), avg(b) FROM t2 WHERE b>=9200 AND b<10200;
SELECT count(*), avg(b) FROM t2 WHERE b>=9300 AND b<10300;
SELECT count(*), avg(b) FROM t2 WHERE b>=9400 AND b<10400;
SELECT count(*), avg(b) FROM t2 WHERE b>=9500 AND b<10500;
SELECT count(*), avg(b) FROM t2 WHERE b>=9600 AND b<10600;
SELECT count(*), avg(b) FROM t2 WHERE b>=9700 AND b<10700;
SELECT count(*), avg(b) FROM t2 WHERE b>=9800 AND b<10800;
SELECT count(*), avg(b) FROM t2 WHERE b>=9900 AND b<10900;
COMMIT;
